
<script type="text/javascript">
var id = "<?php if(isset($_GET['id'])){ echo $_GET['id']; } ?>";
var result = id.split(",");

$(document).ready(function(){

	jQuery.extend(jQuery.validator.messages, {
	  required: '*',
	  remote: '*'
	});
	
	$("#ralimorateid").val(result[0]);
	
	$("#informationservices").validate({
		errorClass: "my-error-class",
		validClass: "my-valid-class",
		debug: false,
		rules: {
			services: "required",
			remarks: "required"
		},
		submitHandler: function(form){
				$.post("query/add_ralimoservices.php", $("#informationservices").serialize(), function(data){
					var txt = '';
					$.each(data, function(key, val){
						txt += val;
					});
					
					txt = txt.replace(/[`~!@#$%^&()_+\=?;'"<>\{\}\[\]\\\/]/gi, '');
					var result = txt.split(",");
					
					alert(result[0]);
					window.location.replace("panel.php?page=add_ralimorates");
					cleanDiv();
				});
		}
	});
	
	$("#btnBack").click(function(e){
		e.preventDefault();
		window.location.replace("panel.php?page=add_ralimovehiclerates&id="+result[0]+ ","+result[1]);
		return false;
	});
	 
	 
	function cleanDiv(){
		$('#informationratesdetails').each(function(){
			this.reset();
		});
		$("#dest").show();
		$("#hr").hide();
	} 
	
});
</script>

<!--  start nav-outer-repeat................................................... END -->
 
 <div class="clear"></div>
 
<!-- start content-outer -->
<div id="content-outer">
<!-- start content -->
<div id="content">

<div id="map_canvas"></div>

<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
<tr>
	<th rowspan="3" class="sized"><img src="images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
	<th class="topleft"></th>
	<td id="tbl-border-top">&nbsp;</td>
	<th class="topright"></th>
	<th rowspan="3" class="sized"><img src="images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
</tr>
<tr>
	<td id="tbl-border-left"></td>
	<td>
	<!--  start content-table-inner -->
	<div id="content-table-inner">
	
	<table border="0" width="100%" cellpadding="0" cellspacing="0">
	<tr valign="top">
	<td>
	
	
		<!--  start step-holder -->
		<div id="step-holder">
			<div class="step-no">1</div>
			<div class="step-light-left">Add Ralimo Details</div>
			<div class="step-light-right">&nbsp;</div>
			<div class="step-no">2</div>
			<div class="step-light-left">Add Ralimo Rates</div>
			<div class="step-light-right">&nbsp;</div>
			<div class="step-no">3</div>
			<div class="step-dark-left">Add Other Services</div>
			<div class="step-dark-round">&nbsp;</div>
			<div class="clear"></div>
		</div>
		<!--  end step-holder -->
	
		<!-- start id-form -->
		<form id="informationservices" method="post" action="">
			<table border="0" cellpadding="0" cellspacing="0"  id="id-form">
				<tr>
					<th valign="top">Other Services:</th>
					<td>
						<textarea id="services" name="services" rows="8" cols="80" placeholder="Other Services." style=" resize: none;"></textarea>
					</td>
				</tr>
	
				<tr>
					<th valign="top">Notes:</th>
					<td>
						<textarea name="remarks" id="remarks" rows="7" cols="80" placeholder="Enter some remarks here." style=" resize: none;"></textarea>
					</td>
				</tr>

				<tr>
					<th>&nbsp;</th>
					<td valign="top">
						<input type="submit" class="form-submit" />
						<input type="button" id="btnBack" class="form-back"  />
						<input type="reset" value="" class="form-reset"  />
						
					</td>
					<td></td>
				</tr>
			
		</table>
		<input type="hidden" id="ralimorateid" name="ralimorateid"/>
	</form>
	<!-- end id-form  -->

	</td>
	<td>
	
	
	<!--  start related-activities -->
	<div id="related-activities">
		
		<!--  start related-act-top -->
		<div id="related-act-top">
		<img src="images/forms/step_bar.png" width="271" height="43" alt="" />
		</div>
		<!-- end related-act-top -->
		
		<!--  start related-act-bottom -->
		<div id="related-act-bottom">
		
			<!--  start related-act-inner -->
			<div id="related-act-inner">
			
				<div class="left"><a href=""><img src="images/forms/icon_plus.gif" width="21" height="21" alt="" /></a></div>
				<div class="right">
					<h5>Adding an affiliate:</h5><br>
					<ul class="greyarrow">
						<li>First, fill up necessary information.</li>
						<li>If done adding necessary information just click Submit.</li>
					</ul>
				</div>
				
				<div class="right" style="color:red;">
					<h5>Note:</h5>
					Please don't click the back button from the Tool Bar above.
				</div>
				
				<div class="clear"></div>
			</div>
			<!-- end related-act-inner -->
			<div class="clear"></div>
		
		</div>
		<!-- end related-act-bottom -->
	
	</div>
	<!-- end related-activities -->
	
	

</td>
</tr>
<tr>
<td><img src="images/shared/blank.gif" width="695" height="1" alt="blank" /></td>
<td></td>
</tr>
</table>
 
<div class="clear"></div>
 

</div>
<!--  end content-table-inner  -->
</td>
<td id="tbl-border-right"></td>
</tr>
<tr>
	<th class="sized bottomleft"></th>
	<td id="tbl-border-bottom">&nbsp;</td>
	<th class="sized bottomright"></th>
</tr>
</table>



<div class="clear">&nbsp;</div>

</div>
<!--  end content -->
<div class="clear">&nbsp;</div>
</div>
<!--  end content-outer -->


<div class="clear">&nbsp;</div>
